/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package BeansGerenciaveis;

import DAO.NoticiaDAO;
import bean.Noticia;
import java.sql.Time;
import java.util.Date;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ApplicationScoped;

/**
 *
 * @author jorgepereira
 */
@ManagedBean
@ApplicationScoped
public class NoticiasDestaqueBean {

    /**
     * Creates a new instance of NoticiasDestaqueBean
     */
    public NoticiasDestaqueBean() {
        
    }
    
    int anoAtual;

    public int getAnoAtual() {
        anoAtual = new Date().getYear();
        return anoAtual;
    }

    public void setAnoAtual(int anoAtual) {
        this.anoAtual = anoAtual;
    }
    
    
    
    List<Noticia> noticias;

    public List<Noticia> getNoticias() {
        if(noticias == null){
            noticias = new NoticiaDAO().buscarChamada();
        }
        return noticias;
    }

    public void setNoticias(List<Noticia> noticias) {
        this.noticias = noticias;
    }
    
    
    
}
